package com.hnevc.chenqi;
/*
 *超市对象
 */

public class Market {
    private String marketName;//超市名称
    private Product[] products;//商品是一个对象，并且存在很多的商品，商品拥有自己的属性

    public String getMarketName() {
        return marketName;
    }

    public void setMarketName(String marketName) {
        this.marketName = marketName;
    }

    public Product[] getProducts() {
        return products;
    }

    public void setProducts(Product[] products) {
        this.products = products;
    }

    Product sell(String proName) {//
        for (int i = 0; i < products.length; i++) {
            if (products[i].getProName() == proName) {
                return products[i];
            }
        }
        return null;
    }
}
